package org.kongqian.sysmanager.service.impl;

import org.kongqian.sysmanager.domain.Dictionary;
import org.kongqian.sysmanager.mapper.DictionaryMapper;
import org.kongqian.sysmanager.mapper.DictionaryitemMapper;
import org.kongqian.sysmanager.service.IDictionaryService;
import org.kongqian.basic.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author kq
 * @since 2022-10-21
 */
@Service
public class DictionaryServiceImpl extends BaseServiceImpl<Dictionary> implements IDictionaryService {

    @Autowired
    private DictionaryMapper dictionaryMapper;

    @Autowired
    private DictionaryitemMapper dictionaryitemMapper;


    @Override
    public void batchDelete(List<Long> ids) {
        dictionaryMapper.batchDelete(ids);
    }

    @Override
    public void deleteDe(Long id) {
        try {
            dictionaryitemMapper.deleteByItem(id);
            dictionaryMapper.deleteById(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
